<template>
  <div>
    <web-link-q-r-code-form
    ref="form"
    :initForm="initForm"
    :accessUrl="accessUrl"
    @cancel="cancel"
    @submit-form="addWebOutLink"/>
  </div>
</template>

<script>
  import WebLinkQRCodeForm from './OutWebLinkQRCodeForm'
  export default {
    name: 'AddWebLinkQRCode',
    data () {
      return {
        initForm: {
          source: '',
          url: '',
          logo: {
            name: '',
            url: ''
          },
          isQRcode: false
        }
      }
    },
    props: {
      accessUrl: String
    },
    components: {
      WebLinkQRCodeForm
    },
    methods: {
      addWebOutLink (form) {
        this.$refs.form.restForm()
        this.$emit('add-success', form)
      },
      cancel () {
        this.$emit('cancel', 'add')
      }
    }
  }
</script>